//
// Created by 14590 on 25-9-2.
//

#include "menu.h"

void DispMenu()
{
    LCD_SetTextFont(&CH_Font24);			// 设置2424中文字体,ASCII字体对应为2412
    LCD_SetColor(LCD_BLACK);				// 设置画笔颜色
    LCD_SetBackColor(LCD_WHITE);
    LCD_DisplayText(0, 0,"F1 System Configure");
    LCD_DisplayText(0, 32,"F2 Parameter Setting");
    LCD_DisplayText(0, 64,"F3 Calibration Mode");
    LCD_DisplayText(0, 96,"F4 Competition Mode");
    LCD_SetColor(LIGHT_BLUE);
    LCD_DrawImage(12, 128, 200,168, gImage_Dart);
    LCD_SetColor(LCD_BLACK);
    LCD_SetTextFont(&CH_Font24);
}

void KeyMenu() {
    if (Key_F1_Down) {
        PageType = syscfg;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_F2_Down) {
        PageType = paraset;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_F3_Down) {
        PageType = calimode;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_F4_Down) {
        PageType = compmode;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_0_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_1_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_2_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_3_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_4_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_5_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_6_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_7_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_8_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_9_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_UP_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_MID_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_DOWN_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_LEFT_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
    else if (Key_RIGHT_Down) {
        PageType = menu;
        osSemaphoreRelease(PageSwSemBinaryHandle);
    }
}